package com.moli.iov.admin.websocket.utils;

import java.util.HashSet;
import java.util.Set;

public class WebSocketContant {

    public static final String VEHICLE_MONITOR = "vehicleMonitor";
    public static final String ONLINE_MONITOR = "onlineMonitor";
    public static final String PARAMSETDETAIL_LIST = "paramSetDetailList";
    public static final String QUERY_PARAM = "queryParam";
    public static final String VEHICLE_TBOX = "vehicleTbox";
    public static final String VEHICLEMONITOR_DETAIL = "vehicleMonitorDetail";
    public static final String VEHICLEDETAIL_PAGE = "vehicleDetailPage";
//    public static final String HOME_ALARM_FAILURE_LIST = "homeAlarmFailure";
    //监控报警未解除数，车载终端未解除数，电子围栏报警未解除数统计
    public static final String ALARM_COUNT_STATISTICS = "alarmStatisticsWService";

    public static final Set<String> set;

    static {
        set = new HashSet<>();
        set.add(VEHICLE_MONITOR);
        set.add(ONLINE_MONITOR);
        set.add(PARAMSETDETAIL_LIST);
        set.add(QUERY_PARAM);
        set.add(VEHICLE_TBOX);
        set.add(VEHICLEMONITOR_DETAIL);
        set.add(VEHICLEDETAIL_PAGE);
//        set.add(HOME_ALARM_FAILURE_LIST);
        set.add(ALARM_COUNT_STATISTICS);
    }

    public static Boolean checkGroup(String newMethod, String oldMethod) {
        switch (newMethod) {
            case ONLINE_MONITOR:
                return oldMethod.equals(ALARM_COUNT_STATISTICS);
            case ALARM_COUNT_STATISTICS:
                return oldMethod.equals(ONLINE_MONITOR);
            default:
                return false;
        }
    }

    public static Boolean contains(String val) {
        return set.contains(val);
    }
}
